-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inherit Qt UI design from .ui files #6
Draft
benjaminhwilliams
wants to merge
31
commits into
master
Choose a base branch
from
inherit-ui-design
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make sure that we remove the exit button from the log output tab, regardless of its position in the tab bar.
These previously changed in the OptionsWindow.ui design file.
Simplify the code by removing the corresponding hard-coded definitions.
Add a caption to the dialogue widget and the filter selector. Default to the location of any previously selected instrument model file. Don't unset the reference instrument model file selection if the dialogue widget is cancelled. Remove redundant setScaledContents calls.
Remove a setText from UIOptionsWindow.browse_for_reference_model because it is now redundant. Also tidy up the wording of some widget labels.
This comment has been minimized.
This comment has been minimized.
Thanks LGTM!
Also correct some usages of a renamed attribute.
Serialise saved options to a JSON file. Options to be saved are determined by searching all the attributes of a UIOptionsWindow instance. If the type of an attribute matches a list of recognised user-input widget types, then we record the value of a specific pre-determined property of each widget. For now, the recognised user-input widget types are QCheckBox, QComboBox and QLineEdit, with the corresponding properties 'checked', 'currentIndex' and 'text' recorded.
Use QtCore.QObject.tr instead of QtCore.QCoreApplication.translate. Translate all user-facing strings. Rationalise some capitalisation.
Also make it so that a UIOptionsWindow without a parent falls back to logging with a simple print call.
This pull request introduces 1 alert when merging d38e701 into da99620 - view on LGTM.com new alerts:
|
Also add some handy placeholder text in some of the options widgets.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rather than hard-coding the UI design in Python, use
.ui
files design files, which can be edited in design editors such as Qt Designer. This allows us to make changes in future to the UI without having to keep track of reams of Python code. The.ui
files are simply imported withPyQt5.uic.loadUi
, to inherit the structure and basic behaviour of the widgets. One then need only connect the appropriate signals and slots to methods and functions in Python.Closes #4.